babl: check both source/dest bits/component in bad_idea()
authorØyvind Kolås <pippin@gimp.org>
Mon, 25 Sep 2017 19:00:08 +0000 (21:00 +0200)
committerØyvind Kolås <pippin@gimp.org>
Mon, 25 Sep 2017 19:00:08 +0000 (21:00 +0200)
babl/babl-fish-path.c

index 6b2874bd2a88d1beeb4a459bb6fe842e392fb48a..2a71464b9b608ea1896f39ec1da487d9e2ea87a3 100644 (file)
@@ -165,7 +165,8 @@ bad_idea (const Babl *from, const Babl *to, const Babl *format)
   {
     return 1;
   }
-  if (from->format.type[0]->bits > format->format.type[0]->bits)
+  if (from->format.type[0]->bits > format->format.type[0]->bits &&
+      to->format.type[0]->bits > format->format.type[0]->bits)
   {
     /* XXX: perhaps we especially avoid going to half-float, when
      * going between u16 formats as well? */